<template>
  <a-modal style="top: 10px" :bodyStyle="{ padding: '0', 'max-height': '80vh', 'overflow-y': 'auto' }" :title="title"
    :width="1200" :maskClosable="false" :visible="visible" @cancel="visible = false" :button_loading="button_loading">
    <a slot="footer">
      <a-button v-if="cancelText" @click="visible = false">{{ cancelText }}</a-button>
      <!-- <a-button v-if="okText == '保存'" type="primary" :loading="button_loading" @click="handleSubmit">{{ okText }}</a-button>-->
      <a-button v-if="okText == '关闭'" type="primary" @click="visible = false">{{ okText }}</a-button>
    </a>

    <a-spin :indicator="indicator" :spinning="spinning" :tip="tip">
      <div class="spin-content">
        <a-tabs default-active-key="1">
          <a-tab-pane key="1" tab="工程情况">
            <a-descriptions v-if="infoData.projectType != '3534'" title="基本信息" :column="4" layout="vertical">
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">项目名</span>
                {{ infoData.projectName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">工程编号</span>
                {{ infoData.No }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">所属板块</span>
                {{ infoData.DepartmentName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">工程类型</span>
                {{ infoData.ProjectTypeName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建筑面积或规模</span>

                {{ infoData.buildingArea }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">投资额(万元)</span>

                {{ infoData.investment }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">开工日期</span>

                {{ tranDate(infoData.startDate) }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">拟竣工日期</span>

                {{ tranDate(infoData.endDate) }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位</span>

                {{ infoData.ownerUnit }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位法定代表人</span>

                {{ infoData.ownerUnitLegalRepresentative }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位负责人</span>

                {{ infoData.ownerUnitHead }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位联系电话</span>

                {{ infoData.ownerUnitPhone }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">施工单位</span>

                {{ infoData.constructionUnit }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">施工单位法定代表人</span>

                {{ infoData.constructionUnitLegalRepresentative }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">施工单位负责人</span>

                {{ infoData.constructionUnitHead }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">施工单位联系电话</span>
                {{ infoData.constructionUnitPhone }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">监理单位</span>
                {{ infoData.supervisorUnit }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">监理单位负责人</span>
                {{ infoData.supervisorUnitHead }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">监理单位联系电话</span>
                {{ infoData.supervisorUnitPhone }}
              </a-descriptions-item>

              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">地址</span>
                {{ infoData.address }}
              </a-descriptions-item>

              <template v-if="infoData.projectType == '3535'">
                <a-descriptions-item :span="2">
                  <span slot="label" class="fore-descriptions-item-label">所在楼盘（或物业名称）</span>
                  {{ infoData.residentialName }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">门牌号</span>
                  {{ infoData.houseNumber }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">室号</span>
                  {{ infoData.roomNumber }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">物业单位名称</span>
                  {{ infoData.pmcName }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">物业单位负责人</span>
                  {{ infoData.pmcHead }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">物业单位联系电话</span>
                  {{ infoData.pmcPhone }}
                </a-descriptions-item>
                <a-descriptions-item>
                  <span slot="label" class="fore-descriptions-item-label">是否变更墙体</span>
                  <a-switch :checked="infoData.isChangeWall" />
                </a-descriptions-item>
                <a-descriptions-item :span="4">
                  <span slot="label" class="fore-descriptions-item-label">施工单位营业执照照片</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitBusinessLicenseUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitBusinessLicenseUrl)" width="150px" alt="施工单位营业执照照片" />
                  </a-popover>
                </a-descriptions-item>
                <a-descriptions-item :span="1">
                  <span slot="label" class="fore-descriptions-item-label">施工单位法定代表人身份证(正面)照片</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitLegalRepresentativeIDCardUrl))"
                        type="primary" style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitLegalRepresentativeIDCardUrl)" width="150px"
                      alt="施工单位法定代表人身份证(正面)照片" />
                  </a-popover>
                </a-descriptions-item>
                <a-descriptions-item :span="1">
                  <span slot="label" class="fore-descriptions-item-label">施工单位法定代表人身份证(反面)照片</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.ConstructionlnitLegalRepresentativeIDCardOppositelrl))"
                        type="primary" style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.ConstructionlnitLegalRepresentativeIDCardOppositelrl)" width="150px"
                      alt="施工单位法定代表人身份证(反面)照片" />
                  </a-popover>
                </a-descriptions-item>
                <a-descriptions-item :span="1">
                  <span slot="label" class="fore-descriptions-item-label">施工单位负责人身份证(正面)照片</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitHeadIDCardUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitHeadIDCardUrl)" width="150px" alt="施工单位负责人身份证(正面)照片" />
                  </a-popover>
                </a-descriptions-item>
                <a-descriptions-item :span="1">
                  <span slot="label" class="fore-descriptions-item-label">施工单位负责人身份证(反面)照片</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitHeadIDCardOppositeUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitHeadIDCardOppositeUrl)" width="150px"
                      alt="施工单位负责人身份证(反面)照片" />
                  </a-popover>
                </a-descriptions-item>
                <a-descriptions-item :span="1">
                  <span slot="label" class="fore-descriptions-item-label">施工单位负责人签名</span>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitHeadSignUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitHeadSignUrl)" width="150px" alt="施工单位负责人签名" />
                  </a-popover>
                </a-descriptions-item>
              </template>

              <a-descriptions-item v-if="infoData.projectType == '3535'" :span="3">
                <span slot="label" class="fore-descriptions-item-label">应提供材料</span>
                <span v-for="(photo, index) in infoData.Informations" :key="index">
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(`${photo.Path}/${photo.NewFileName}`))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(`${photo.Path}/${photo.NewFileName}`)" width="150px" height="150px" alt=""
                      style="margin: 20px" />
                  </a-popover>
                </span>
                <!-- {{ infoData.Informations }} -->
              </a-descriptions-item>
              <a-descriptions-item v-else :span="3">
                <span slot="label" class="fore-descriptions-item-label">应提供材料</span>
                {{ infoData.provideData }}
              </a-descriptions-item>
              <a-descriptions-item :span="1">
                <span slot="label" class="fore-descriptions-item-label">工程情况</span>

                {{ infoData.projectSituation }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位签名</span>
                <a-popover title="">
                  <template slot="content">
                    <a-button @click="viewPhoto(getImg(infoData.signImgUrl))" type="primary" style="margin-left: 5px"
                      size="small">查看大图</a-button>
                  </template>
                  <img :src="getImg(infoData.signImgUrl)" width="150px" alt="建设单位签名" />
                </a-popover>
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">相关照片</span>
                <span v-for="(photo, index) in infoData.ProjectPhotos" :key="index">
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(`${photo.Path}/${photo.NewFileName}`))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(`${photo.Path}/${photo.NewFileName}`)" width="150px" height="150px" alt=""
                      style="margin: 20px" />
                  </a-popover>
                </span>
              </a-descriptions-item>
            </a-descriptions>

            <a-descriptions v-if="infoData.projectType == '3534'" title="基本信息(拆除工程)" :column="4" layout="vertical">
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">工程编号</span>
                {{ infoData.No }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">所属板块</span>
                {{ infoData.DepartmentName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">工程类型</span>
                {{ infoData.ProjectTypeName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建筑面积或规模</span>
                {{ infoData.buildingArea }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位</span>
                {{ infoData.ownerUnit }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位法定代表人</span>
                {{ infoData.ownerUnitLegalRepresentative }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位负责人</span>
                {{ infoData.ownerUnitHead }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位联系电话</span>
                {{ infoData.ownerUnitPhone }}
              </a-descriptions-item>
              <a-descriptions-item :span="1">
                <span slot="label" class="fore-descriptions-item-label">工程情况</span>
                {{ infoData.projectSituation }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位签名</span>
                <a-popover title="">
                  <template slot="content">
                    <a-button @click="viewPhoto(getImg(infoData.signImgUrl))" type="primary" style="margin-left: 5px"
                      size="small">查看大图</a-button>
                  </template>
                  <img :src="getImg(infoData.signImgUrl)" width="150px" alt="建设单位签名" />
                </a-popover>
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">相关照片</span>
                <span v-for="(photo, index) in infoData.ProjectPhotos" :key="index">
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(`${photo.Path}/${photo.NewFileName}`))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(`${photo.Path}/${photo.NewFileName}`)" width="150px" height="150px" alt=""
                      style="margin: 20px" />
                  </a-popover>
                </span>
              </a-descriptions-item>
            </a-descriptions>
            <a-divider />

            <a-descriptions v-if="infoData.projectType == '3534'" title="拆除施工单位" :column="4" layout="vertical">
              <a-descriptions-item :span="4">
                <span slot="label" class="fore-descriptions-item-label">单位名称</span>
                {{ infoData.constructionUnit }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">单位负责人</span>
                {{ infoData.constructionUnitHead }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">联系方式</span>
                {{ infoData.constructionUnitPhone }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">项目经理</span>
                {{ infoData.projectManager }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">联系方式</span>
                {{ infoData.projectManagerPhone }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">项目安全员</span>
                {{ infoData.safetyOfficer }}
              </a-descriptions-item>
              <a-descriptions-item :span="2">
                <span slot="label" class="fore-descriptions-item-label">联系方式</span>
                {{ infoData.safetyOfficerPhone }}
              </a-descriptions-item>
            </a-descriptions>
            <a-descriptions v-if="infoData.projectType == '3534'" title="拆除工程项目基本情况" :column="4" layout="vertical">
              <a-descriptions-item :span="4">
                <span slot="label" class="fore-descriptions-item-label">项目名</span>
                {{ infoData.projectName }}
              </a-descriptions-item>
              <a-descriptions-item :span="4">
                <span slot="label" class="fore-descriptions-item-label">项目地址</span>
                {{ infoData.constructionUnit }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">主体结构</span>
                {{ (infoData.mainStructureOther != null && infoData.mainStructureOther != '') ? `其他：${ infoData.mainStructureOther }` : infoData.MainStructureName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">拆除类型</span>
                {{ (infoData.demolitionTypeOther != null && infoData.demolitionTypeOther != '') ? `其他：${ infoData.demolitionTypeOther }` : infoData.DemolitionTypeName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建筑面积</span>
                {{ infoData.buildingArea }} 平方米
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">户数(住宅、非住宅)</span>
                {{ infoData.households }} 户
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">开始时间</span>
                {{ tranDate(infoData.startDate) }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">完工时间</span>
                {{ tranDate(infoData.endDate) }}
              </a-descriptions-item>
            </a-descriptions>
            <a-divider />

            <a-descriptions title=" 勘察信息" :column="3" layout="vertical">
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">是否勘察</span>

                <a-switch :checked="infoData.isExamine" />
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">勘察人</span>

                {{ infoData.ExamineUser }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">勘察日期</span>

                {{ tranDate(infoData.examineTime) }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">备案表</span>
                <div>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.registerTableImgUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.registerTableImgUrl)" width="150px" height="150px" alt="备案表" />
                  </a-popover>
                </div>
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位承诺书</span>

                <div>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.ownerUnitCommitmentImgUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.ownerUnitCommitmentImgUrl)" width="150px" height="150px" alt="建设单位承诺书" />
                  </a-popover>
                </div>
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">施工单位承诺书</span>

                <div>
                  <a-popover title="">
                    <template slot="content">
                      <a-button @click="viewPhoto(getImg(infoData.constructionUnitCommitmentImgUrl))" type="primary"
                        style="margin-left: 5px" size="small">查看大图</a-button>
                    </template>
                    <img :src="getImg(infoData.constructionUnitCommitmentImgUrl)" width="150px" height="150px"
                      alt="施工单位承诺书" />
                  </a-popover>
                </div>
              </a-descriptions-item>
            </a-descriptions>
            <a-divider />
            <a-descriptions title="完工信息" :column="3" layout="vertical">
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">建设单位确认完工日期</span>
                {{ tranDate(infoData.ownerUnitCompleteProjectTime) }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">监管单位确认完工人姓名</span>
                {{ infoData.ConfirmUserName }}
              </a-descriptions-item>
              <a-descriptions-item>
                <span slot="label" class="fore-descriptions-item-label">监管单位确认完工日期</span>
                {{ tranDate(infoData.trueEndDate) }}
              </a-descriptions-item>
            </a-descriptions>
          </a-tab-pane>

          <a-tab-pane key="2" tab="工程时间轴" force-render>
            <a-card class="card" title="工程过程" :bordered="false" size="small">
              <a-timeline mode="left">
                <div v-for="(flow, index) in infoData.FlowNodes" :key="index">
                  <a-row>
                    <a-col :span="2">
                      <label for="">{{ flow.Time }}</label>
                    </a-col>
                    <a-col :span="22">
                      <a-timeline-item class="fore-timeline-item">
                        {{ flow.Name }}
                        <p>{{ flow.Event }}</p>
                      </a-timeline-item>
                    </a-col>
                  </a-row>
                </div>
              </a-timeline>
            </a-card>
          </a-tab-pane>

          <a-tab-pane key="3" tab="文件下载">
            <a-descriptions title="" :column="1">
              <a-descriptions-item label="备案表">
                <a @click="exportXls('ExportBAB')">下载</a>
              </a-descriptions-item>
              <a-descriptions-item label="公示牌">
                <a v-if="infoData.isExamine==true" @click="exportXls('ExportGSP')">下载</a>
                <a v-else-if ="infoData.isExamine==null">勘察后可下载</a>
              </a-descriptions-item>
              <a-descriptions-item label="建设单位承诺书">
                <a @click="exportXls('ExportJSDWCRS')">下载</a>
              </a-descriptions-item>
              <a-descriptions-item label="施工单位承诺书">
                <a @click="exportXls('ExportSGDWCRS')">下载</a>
              </a-descriptions-item>
            </a-descriptions>
          </a-tab-pane>
        </a-tabs>
      </div>
    </a-spin>
    <photo-modal ref="photomodal"></photo-modal>
  </a-modal>
</template>

<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { mapActions, mapGetters } from 'vuex'
import { tranDate } from '@/utils/util'
import PhotoModal from '@/views/photoModal'

import { ExportBAB, ExportGSP, ExportJSDWCRS, ExportSGDWCRS } from '@/api/project'

export default {
  components: { PhotoModal },
  props: {
    actionType: {
      type: String,
      required: false,
      default: 'add',
    },
  },
  created() { },
  mounted() { },
  data() {
    return {
      a: null,
      action: 'add',
      headers: {},
      currentId: null,
      CodeDisabled: false,
      required: false,
      indicator: <a-icon type="loading" style="font-size: 24px" spin />,
      form: this.$form.createForm(this),
      button_loading: false,
      spinning: false,
      tip: null,
      title: '查看',
      visible: false,
      okText: '保存',
      cancelText: '取消',
      infoData: {},
      tranDate: tranDate,
    }
  },
  watch: {},
  computed: { ...mapGetters(['token']) },
  methods: {
    view(data) {
      Object.assign(this, {
        spinning: true,
        visible: true,
        CodeDisabled: false,
        currentId: data.id,
        title: '查看',
      })
      this.initData(data)
      this.buttonText(this.actionType)
      console.log(this.infoData.projectType)
    },
    initData(data) {
      this.spinning = false
      data.FlowNodes.map((f) => (f.Time = tranDate(f.Time)))
      this.infoData = data
    },
    buttonText(actionType) {
      if (actionType == 'view') {
        this.okText = '关闭'
        this.cancelText = null
      } else {
        this.okText = '保存'
        this.cancelText = '关闭'
      }
    },

    exportXls(str) {
      const _this = this
      const param = { projectID: _this.infoData.id }
      switch (str) {
        case 'ExportBAB':
          ExportBAB(param)
            .then((res) => {
              const a = `${process.env.VUE_APP_API_BASE_URL}${res.data}`
              window.open(a)
            })
            .finally(() => {
              this.spinning = false
            })
          break
        case 'ExportGSP':
          ExportGSP(param)
            .then((res) => {
              const a = `${process.env.VUE_APP_API_BASE_URL}${res.data}`
              window.open(a)
            })
            .finally(() => {
              this.spinning = false
            })
          break
        case 'ExportJSDWCRS':
          ExportJSDWCRS(param)
            .then((res) => {
              const a = `${process.env.VUE_APP_API_BASE_URL}${res.data}`
              window.open(a)
            })
            .finally(() => {
              this.spinning = false
            })
          break
        case 'ExportSGDWCRS':
          ExportSGDWCRS(param)
            .then((res) => {
              const a = `${process.env.VUE_APP_API_BASE_URL}${res.data}`
              window.open(a)
            })
            .finally(() => {
              this.spinning = false
            })
          break
        default:
          break
      }
    },
    getImg(str) {
      const url = `${process.env.VUE_APP_API_BASE_URL}${str}`
      return url
    },
    viewPhoto(data) {
      this.$refs.photomodal.view(data)
    },
  },
}
</script>
<style lang="less" scoped>
.ant-card {
  /deep/.ant-card-small>.ant-card-body {
    padding: 0 12px;
  }

  /deep/.ant-card-head-wrapper {
    line-height: 16px;
  }
}

/deep/.ant-tabs-nav .ant-tabs-tab {
  font-size: 15px;
  font-weight: bold;
}

/deep/.ant-popover-inner-content {
  padding: 0;
}

.ant-form-item {
  margin-bottom: 4px;
}

.avatar-uploader>.ant-upload {
  width: 104px;
  height: 104px;
}

.ant-upload-list-picture-card-container {
  width: 104px;
  height: 104px;
}

.ant-upload-select-picture-card i {
  font-size: 32px;
  color: #999;
}

.ant-upload-select-picture-card .ant-upload-text {
  margin-top: 8px;
  color: #666;
}

.notclickn {
  pointer-events: none;
}

.spin-content {
  margin: 10px;

  .ability {
    .checkbox {
      padding-bottom: 10px;

      .remark_input {
        margin-left: 10px;
        width: 180px;
      }
    }

    .checkbox2 {
      /deep/.ant-checkbox-group-item {
        display: block;
        margin-bottom: 5px;
      }
    }

    .title_top {
      color: @primary-color;
      font-weight: bold;
      font-size: 18px;
      margin-bottom: 10px;
    }

    .bottom_dash {
      border-bottom: 1px dashed #d6d5b7;
    }

    .right_dash {
      border-right: 1px dashed #d6d5b7;
    }
  }

  /deep/.ant-tabs .ant-tabs-left-bar .ant-tabs-ink-bar {
    height: 0px !important;
  }

  /deep/.ant-card-head {
    border-bottom: none;
  }

  /deep/.ant-tabs-nav .ant-tabs-tab-active {
    background-color: #3b5998;
    color: #ffffff;
  }

  /deep/.ant-tabs-nav .ant-tabs-tab:hover {
    background-color: #3b5998 !important;
  }

  .card_title {
    font-size: 15px;
    font-weight: 900;
    color: @primary-color;
  }
}

.viewless {
  /deep/.ant-input-group-addon {
    display: none;
  }

  /deep/.ant-input-number {
    border: none;
    background: transparent;
  }

  /deep/.ant-input {
    border: none;
    background: transparent;
  }

  .ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /deep/.ant-input-disabled {
    color: rgba(0, 0, 0, 0.65);
    cursor: default;
  }

  /deep/.ant-select-disabled {
    color: rgba(0, 0, 0, 0.65);
  }

  // /deep/.ant-modal-content {
  //   pointer-events: unset;
  // }
  /deep/.ant-select-selection--single {
    border: none;
    background: transparent;
  }

  /deep/.ant-select-arrow .ant-select-arrow-icon {
    display: none;
  }

  /deep/.anticon {
    display: none;
  }

  /deep/.vue-treeselect div,
  .vue-treeselect span {
    border: none;
  }

  /deep/.vue-treeselect__x-container {
    display: none;
  }

  /deep/.vue-treeselect__control-arrow-container {
    display: none;
  }

  /deep/.fore-timeline-item {
    position: relative;
    margin: 0;
    padding: 0 0 20px;
    font-size: 14px;
    list-style: none;
    left: 100px;
    top: -20px;
  }
}

.fore-descriptions-item-label {
  font-weight: bolder;
}

/deep/.ant-descriptions-title {
  border-left: 5px solid #1890ff;
}
</style>
